#ifndef TCCLASS_H
#define TCCLASS_H
#include "spherical_arc.h"
#include "posemath.h"
#include "emcpos.h"
#include "tc_types.h"
#include "tp_types.h"

class TcClass
{
public:
    TcClass();


    static int tcGetEndpoint_hualeiTest(TC_STRUCT const * const tc, EmcPose * const out);
    static int tcGetStartpoint(TC_STRUCT const * const tc, EmcPose * const out);
    static int tcGetPos(TC_STRUCT const * const tc,  EmcPose * const out);
    static int tcGetPosReal(TC_STRUCT const * const tc, int of_endpoint,  EmcPose * const out);
    static int tcGetEndAccelUnitVector(TC_STRUCT const * const tc, PmCartesian * const out);
    static int tcGetStartAccelUnitVector(TC_STRUCT const * const tc, PmCartesian * const out);
    static int tcGetEndTangentUnitVector(TC_STRUCT const * const tc, PmCartesian * const out);
    static int tcGetStartTangentUnitVector(TC_STRUCT const * const tc, PmCartesian * const out);

    static int tcGetIntersectionPoint(TC_STRUCT const * const prev_tc,
            TC_STRUCT const * const tc, PmCartesian * const point);

    static int tcCanConsume(TC_STRUCT const * const tc);

    static int tcSetTermCond(TC_STRUCT * const tc, int term_cond);

    static int tcConnectBlendArc(TC_STRUCT * const prev_tc, TC_STRUCT * const tc,
            PmCartesian const * const circ_start,
            PmCartesian const * const circ_end);

    static int tcIsBlending(TC_STRUCT * const tc);


    static int tcFindBlendTolerance(TC_STRUCT const * const prev_tc,
            TC_STRUCT const * const tc, double * const T_blend, double * const nominal_tolerance);

    static int pmCircleTangentVector(PmCircle const * const circle,
            double angle_in, PmCartesian * const out);

    static int tcFlagEarlyStop(TC_STRUCT * const tc,
            TC_STRUCT * const nexttc);

    static double pmLine9Target(PmLine9 * const line9, int robotIdIn);

    static int pmLine9Init(PmLine9 * const line9,
            EmcPose const * const start,
            EmcPose const * const end);

    static double pmCircle9Target(PmCircle9 const * const circ9);

    static int pmCircle9Init(PmCircle9 * const circ9,
            EmcPose const * const start,
            EmcPose const * const end,
            PmCartesian const * const center,
            PmCartesian const * const normal,
            int turn);

    static int pmRigidTapInit(PmRigidTap * const tap,
            EmcPose const * const start,
            EmcPose const * const end);

    static double pmRigidTapTarget(PmRigidTap * const tap, double uu_per_rev);

    static int tcInit(TC_STRUCT * const tc,
            int motion_type,
            int canon_motion_type,
            double cycle_time,
            unsigned char enables,
            char atspeed);

    static int tcSetupFromTP(TC_STRUCT * const tc, TP_STRUCT const * const tp);

    static int tcSetupMotion(TC_STRUCT * const tc,
            double vel,
            double ini_maxvel,
            double acc);

    static int tcSetupState(TC_STRUCT * const tc, TP_STRUCT const * const tp);

    static int tcFinalizeLength(TC_STRUCT * const tc);

    static int tcClampVelocityByLength(TC_STRUCT * const tc);

    static int tcPureRotaryCheck(TC_STRUCT const * const tc);

    static int tcSetCircleXYZ(TC_STRUCT * const tc, PmCircle const * const circ);

    static int tcClearFlags(TC_STRUCT * const tc);
};

#endif // TCCLASS_H
